<!DOCTYPE html>
<html>

<head>
    <title>评论</title>
    <link rel='stylesheet' href='/stylesheets/style.css' />
    <link rel='stylesheet' href='/stylesheets/comment.css' />
    <script type="text/javascript" src="/js/xheditor/jquery/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" src="/js/xheditor/xheditor-1.2.2.min.js"></script>
    <script type="text/javascript" src="/js/xheditor/xheditor_lang/zh-cn.js"></script>

</head>

<body>
    <div class="wrap">
        <h1>评论 <span>电影名字</span></h1>
        <form action="/comment/submit" method="post" enctype="">
            <label for="title" class="tip"> 题目：</label>
            <br/>
            <input type="text" name="title" id="title">
            <br/>
            <label for="title" class="tip"> 正文：</label>
            <br/>
            <textarea rows="30" cols="100" name="content" id="content"></textarea>
            <br/>

            <input id="publish" value="发表" type="submit" name="submit">
        </form>

    </div>
    <script type="text/javascript">
        $(pageInit);

        function pageInit() {
            $.extend(XHEDITOR.settings, {
                shortcuts: {
                    'ctrl+enter': submitForm
                }
            });
            $('#content').xheditor({

                html5Upload: false, //上传要求
                upMultiple: "1", //每次上传数量

                upLinkUrl: "upload.php",
                upLinkExt: "zip,rar,txt",

                upImgUrl: "/uploadImg", //上传路径
                upImgExt: "jpg,jpeg,gif,png",

                upFlashUrl: "upload.php",
                upFlashExt: "swf",

                upMediaUrl: "upload.php",
                upMediaExt: "wmv,avi,wma,mp3,mid"
            });

        }

        function insertUpload(arrMsg) {
            console.log(arrMsg)
            var i, msg;
            for (i = 0; i < arrMsg.length; i++) {
                msg = arrMsg[i];
                $("#uploadList").append('<option value="' + msg.id + '">' + msg.localname + '</option>');
            }
        }

        function submitForm() {
            $('#frmDemo').submit();
        }
    </script>


</body>

</html>